<?
if (!isset($r)) $r = "../";
require_once($r."_utilities/api_core.php");


if ($_POST["action"]) $action = $_POST["action"];
else $action = $_GET["action"];

//var_dump($_GET);
if (!$action) die("RTFM");

//-----------------------------------------------------------------------------------------------------------------------------------

if ($action == "login") {
	$api = new API_method("login");	
	$api->UserCheckLogin( $api->params['login'], $api->params['pass'] );
}

//-----------------------------------------------------------------------------------------------------------------------------------

//echo "<hr>";
if ($action == "signup") {
	$api = new API_method("signup");	
	$api->UserSignUp( $api->params['name'], $api->params['email'], $api->params['pass'] );
	

}


//-----------------------------------------------------------------------------------------------------------------------------------

if ($action == "monitor_rss"){
	$api = new API_method("monitor_rss");	
	$api->GetMonitorRSS( $api->params['mid'] );
}


//-----------------------------------------------------------------------------------------------------------------------------------

if ($action == "monitor_delete"){
	$api = new API_method("monitor_delete");	
	$api->DeleteMonitor( $api->params['mid'] );
}



//-----------------------------------------------------------------------------------------------------------------------------------

if ($action == "monitor_create"){
	$api = new API_method("monitor_create");	
	$api->CreateMonitor();
}


//echo "<br>OK";

?>